<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

	<%@ include file="/WEB-INF/include/header.jsp" %>
	<%@ include file="/WEB-INF/include/submenu.jsp" %>
	
	<div class="container-fluid ms-container has-ms-sidemenu">
	
	  <ol class="ms-breadcrumb breadcrumb">
	    <li class="active">车辆信息管理</li>
      <a href="javascript:window.history.back();" class="pull-right" style="margin-right: 10px;">
        <span class="glyphicon glyphicon-arrow-left"></span>&nbsp;返回
      </a>
	  </ol>
	
	  <div class="ms-content-layout">
	
		  <div class="block-heading">
		    <h5>整车基本信息</h5>
		  </div>
		
		  <div class="form-horizontal ms-form form-personal-info">
		
		    <div class="form-group ms-form-group">
			    <label class="control-label col-xs-3 ">1&nbsp;<span class="color-red">*</span>运输公司：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${supplier.name}</p>
			    </div>
          
          <label class="control-label col-xs-2">2&nbsp;<span class="color-red">*</span>车辆同步状态：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${vehicleSource.status.description}</p>
          </div>
		    </div>
		    
		    <div class="form-group ms-form-group">
			    <label class="control-label col-xs-3">3&nbsp;<span class="color-red">*</span>车辆状态 ：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${vehicleSource.vehicleStatus.description}</p>
			    </div>
          
          <label class="control-label col-xs-2">4&nbsp;<span class="color-red">*</span>装载量：</label>
          <div class="col-xs-3 pull-left">
            <c:choose>
              <c:when test="${vehicleSource.hasTrailer()}">
                <p class="form-control-static">${tractor.trainload + trailer.trainload}</p>
              </c:when>
              <c:otherwise>
                <p class="form-control-static">${tractor.trainload}</p>
              </c:otherwise>
            </c:choose>
          </div>
		    </div>
		    
		    <div class="form-group ms-form-group">
			    <label class="control-label col-xs-3 ">5&nbsp;<span class="color-red">*</span>是否同步到TMS：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${vehicleSource.synchronize ? '是' : '否'}</p>
			    </div>
			
			    <label class="control-label col-xs-2 ">6&nbsp;<span class="color-red">*</span>是否锁定：</label>
			    <div class="col-xs-3 pull-left">
			      <c:choose>
			        <c:when test="${empty vehicleSource.lock}">
			          <p class="form-control-static">否</p>
			        </c:when>
			        <c:otherwise>
			          <p class="form-control-static">${vehicleSource.lock ? '是' : '否'}</p>
			        </c:otherwise>
			      </c:choose>
			    </div>
		    </div>
		    
		    <div class="form-group ms-form-group">
		      <label class="control-label col-xs-3">7&nbsp;锁定类型：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${vehicleSource.lockType.description}</p>
          </div>
          
          <label class="control-label col-xs-2">8&nbsp;锁定备注：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty vehicleSource.lockReason ? '无' : vehicleSource.lockReason}</p>
          </div>
		    </div>
        
		  </div>
		  
		  <c:if test="${not empty drivers}">
			  <div class="block-heading">
			    <h5>驾驶员基本信息</h5>
			  </div>
			  
			  <div class="form-horizontal ms-form form-personal-info">
			    <c:forEach var="driver" items="${drivers}">
				    <div class="form-group ms-form-group">
					    <label class="control-label col-xs-3 ">
					      <c:choose>
					        <c:when test="${driver.dutyId eq 10}">主驾：</c:when>
					        <c:otherwise>副驾</c:otherwise>
					      </c:choose>
					    </label>
					    <div class="col-xs-3 pull-left">
					      <p class="form-control-static">${driver.name}</p>
					    </div>
				    </div>
			    </c:forEach>
			  </div>
		  </c:if>
		  
<%--		  <div class="block-heading">--%>
<%--		    <h5>GPS信息</h5>--%>
<%--		  </div>--%>
		  
<%--		  <div class="form-horizontal ms-form form-personal-info">--%>
<%--		    <div class="form-group ms-form-group">--%>
<%--			    <label class="control-label col-xs-3 ">9&nbsp;GPS品牌：</label>--%>
<%--			    <div class="col-xs-3 pull-left">--%>
<%--			      <p class="form-control-static">${tractor.gps}</p>--%>
<%--			    </div>--%>
<%--			--%>
<%--			    <label class="control-label col-xs-2 ">10&nbsp;GPS绑定SIM卡号：</label>--%>
<%--			    <div class="col-xs-3 pull-left">--%>
<%--			      <p class="form-control-static">${tractor.simCard}</p>--%>
<%--			    </div>--%>
<%--		    </div>--%>
<%--		    --%>
<%--		    <div class="form-group ms-form-group">--%>
<%--		      <label class="control-label col-xs-3">11&nbsp;GPS最后更新时间：</label>--%>
<%--          <div class="col-xs-3 pull-left">--%>
<%--            <p class="form-control-static">--%>
<%--              <c:choose>--%>
<%--                <c:when test="${not empty vehicleSource.code}">--%>
<%--                  <fmt:formatDate value="${empty persist.vehicleGpsInfo(vehicleSource.code) ? '' : persist.vehicleGpsInfo(vehicleSource.code).lastModified}" pattern="yyyy-MM-dd HH:mm:ss"/>--%>
<%--                </c:when>--%>
<%--                <c:otherwise>无</c:otherwise>--%>
<%--              </c:choose>--%>
<%--            </p>--%>
<%--          </div>--%>
<%--      --%>
<%--          <label class="control-label col-xs-2 ">12&nbsp;GPS最后更新地点：</label>--%>
<%--          <div class="col-xs-3 pull-left">--%>
<%--            <p class="form-control-static">--%>
<%--              <c:choose>--%>
<%--                <c:when test="${not empty vehicleSource.code}">--%>
<%--                  ${empty persist.vehicleGpsInfo(vehicleSource.code) ? '无' : persist.vehicleGpsInfo(vehicleSource.code).currentLocation}--%>
<%--                </c:when>--%>
<%--                <c:otherwise>无</c:otherwise>--%>
<%--              </c:choose>--%>
<%--            </p>--%>
<%--          </div>--%>
<%--		    </div>--%>
<%--		  </div>--%>
		  
		  <div class="block-heading">
		    <h5>牵引车基本信息</h5>
		  </div>
		
		  <div class="form-horizontal ms-form form-personal-info">
		  
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">13&nbsp;<span class="color-red">*</span>产证所有者：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.floorLord}</p>
          </div>
          
          <label class="control-label col-xs-2">14&nbsp;<span class="color-red">*</span>运输工具类型：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.transMean.description}</p>
          </div>
        </div>
      
		    <div class="form-group  ms-form-group">
			    <label class="control-label col-xs-3">15&nbsp;<span class="color-red">*</span>中文车牌号：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${tractor.brandCNCode}</p>
			    </div>
			    
			    <label class="control-label col-xs-2">16&nbsp;<span class="color-red">*</span>英文车牌号：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.brandENCode}</p>
          </div>
		    </div>
		
		    <div class="form-group  ms-form-group">
			    <label class="control-label col-xs-3">17&nbsp;<span class="color-red">*</span>品牌：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${tractor.brand}</p>
			    </div>
			    
			    <label class="control-label col-xs-2">18&nbsp;<span class="color-red">*</span>VIN码：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.vincode}</p>
          </div>
		    </div>
		
		    <div class="form-group  ms-form-group">
		      <label class="control-label col-xs-3">19&nbsp;<span class="color-red">*</span>马力：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.horsepower}</p>
          </div>
          
          <label class="control-label col-xs-2">20&nbsp;<span class="color-red">*</span>轴数：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.axles}</p>
          </div>
		    </div>
		    
		    <div class="form-group  ms-form-group">
		      <label class="control-label col-xs-3">21&nbsp;<span class="color-red">*</span>发证日期：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static"><fmt:formatDate value="${tractor.issuingTime}" pattern="yyyy-MM-dd"/></p>
          </div>
          
          <label class="control-label col-xs-2">22&nbsp;<span class="color-red">*</span>注册日期：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static"><fmt:formatDate value="${tractor.registrationTime}" pattern="yyyy-MM-dd"/></p>
          </div>
        </div>
		
		    <div class="form-group  ms-form-group">
		      <label class="control-label col-xs-3">23.1&nbsp;<span class="color-red">*</span>年检有效期至：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static"><fmt:formatDate value="${tractor.annualInspectionDate}" pattern="yyyy-MM"/></p>
          </div>
          
          <label class="control-label col-xs-2">23.2&nbsp;<span class="color-red">*</span>装载量：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.trainload}</p>
          </div>
			  </div>
        
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">23.3&nbsp;<span class="color-red">*</span>车辆类型（行驶证）：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.vehicleType.description}</p>
          </div>
          
          <label class="control-label col-xs-2">23.4&nbsp;<span class="color-red">*</span>车辆所属权：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${tractor.carOwnership.description}</p>
          </div>
        </div>
			  
			  <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">24&nbsp;<span class="color-red">*</span>行驶证原件扫描件：</label>
          <div class="col-xs-3 pull-left">
            <c:choose>
              <c:when test="${not empty tractor.drivingLicense}">
                <p class="form-control-static">
                  <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${tractor.drivingLicense}">查看图片</a>
                </p>
              </c:when>
              <c:otherwise>
                <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
              </c:otherwise>
            </c:choose>
          </div>
        
	        <label class="control-label col-xs-2">25&nbsp;<span class="color-red">*</span>行驶证副本及检验页扫描件：</label>
	        <div class="col-xs-3 pull-left">
	          <c:choose>
	            <c:when test="${not empty tractor.drivingLicenseCopy}">
	              <p class="form-control-static">
	                <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${tractor.drivingLicenseCopy}">查看图片</a>
	              </p>
	            </c:when>
	            <c:otherwise>
	              <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
	            </c:otherwise>
	          </c:choose>
	        </div>
	      </div>
        
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">26&nbsp;<span class="color-red">*</span>车头45度角照片：</label>
          <div class="col-xs-3 pull-left">
            <c:choose>
              <c:when test="${not empty tractor.vehiclePhoto}">
                <p class="form-control-static">
                  <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${tractor.vehiclePhoto}">查看图片</a>
                </p>
              </c:when>
              <c:otherwise>
                <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
              </c:otherwise>
            </c:choose>
          </div>
        
          <label class="control-label col-xs-2">27&nbsp;购车合同：</label>
          <div class="col-xs-3 pull-left">
            <c:choose>
              <c:when test="${not empty tractor.vehicleContact}">
                <p class="form-control-static">
                  <a href="${tractor.vehicleContact}" download="${tractor.code}购车合同">购车合同下载</a>
                </p>
              </c:when>
              <c:otherwise>
                <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
              </c:otherwise>
            </c:choose>
          </div>
        </div>
	      
		  </div>
      
      <c:if test="${vehicleSource.hasTrailer()}">
      
  	    <div class="block-heading">
  	      <h5>挂车基本信息</h5>
  	    </div>
  	    
  	    <div class="form-horizontal ms-form form-personal-info">
	    
    	    <div class="form-group  ms-form-group">
    	      <label class="control-label col-xs-3">28&nbsp;<span class="color-red">*</span>产证所有者：</label>
    	      <div class="col-xs-3 pull-left">
    	      <p class="form-control-static">${trailer.floorLord}</p>
    	      </div>
    	      <label class="control-label col-xs-2">29&nbsp;<span class="color-red">*</span>挂车类型：</label>
    	      <div class="col-xs-3 pull-left">
    	        <p class="form-control-static">${trailer.trailerType.description}</p>
    	      </div>
    	    </div>
    	
    	    <div class="form-group  ms-form-group">
    	      <label class="control-label col-xs-3">30&nbsp;<span class="color-red">*</span>中文车牌号：</label>
    	      <div class="col-xs-3 pull-left">
    	        <p class="form-control-static">${trailer.brandCNCode}</p>
    	      </div>
    	      <label class="control-label col-xs-2">31&nbsp;<span class="color-red">*</span>VIN码：</label>
    	      <div class="col-xs-3 pull-left">
    	        <p class="form-control-static">${trailer.vincode}</p>
    	      </div>
    	    </div>
    	
    	    <div class="form-group  ms-form-group">
    	      <label class="control-label col-xs-3">32&nbsp;<span class="color-red">*</span>实际长宽高(m)：</label>
    	      <div class="col-xs-3 pull-left">
    	        <p class="form-control-static">${trailer.length}*${trailer.width}*${trailer.height}</p>
    	      </div>
    	      <label class="control-label col-xs-2">33&nbsp;<span class="color-red">*</span>装载量：</label>
    	      <div class="col-xs-3 pull-left">
    	        <p class="form-control-static">${trailer.trainload}</p>
    	      </div>
    	    </div>
    	
    	    <div class="form-group  ms-form-group">
    	      <label class="control-label col-xs-3">34.1&nbsp;<span class="color-red">*</span>年检有效期至：</label>
    	      <div class="col-xs-3 pull-left">
    	        <p class="form-control-static"><fmt:formatDate value="${trailer.annualInspectionDate}" pattern="yyyy-MM"/></p>
    	      </div>
            
            <label class="control-label col-xs-2">34.2&nbsp;<span class="color-red">*</span>车辆类型（行驶证）：</label>
            <div class="col-xs-3 pull-left">
              <p class="form-control-static">${trailer.vehicleType.description}</p>
            </div>
    	    </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3">34.3&nbsp;<span class="color-red">*</span>品牌：</label>
            <div class="col-xs-3 pull-left">
              <p class="form-control-static">${trailer.brand}</p>
            </div>
          </div>
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3">35&nbsp;<span class="color-red">*</span>行驶证原件扫描件：</label>
            <div class="col-xs-3 pull-left">
              <c:choose>
                <c:when test="${not empty trailer.drivingLicense}">
                  <p class="form-control-static">
                    <a  data-imgsrc="${trailer.drivingLicense}" href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up">查看图片</a>
                  </p>
                </c:when>
                <c:otherwise>
                  <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                </c:otherwise>
              </c:choose>
            </div>
            
            <label class="control-label col-xs-2">36&nbsp;<span class="color-red">*</span>行驶证副本及检验页扫描件：</label>
            <div class="col-xs-3 pull-left">
              <c:choose>
                <c:when test="${not empty trailer.drivingLicenseCopy}">
                  <p class="form-control-static">
                    <a  data-imgsrc="${trailer.drivingLicenseCopy}" href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up">查看图片</a>
                  </p>
                </c:when>
                <c:otherwise>
                  <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                </c:otherwise>
              </c:choose>
            </div>
          </div>  
          
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3">37&nbsp;<span class="color-red">*</span>45度角照片：</label>
            <div class="col-xs-3 pull-left">
              <c:choose>
                <c:when test="${not empty trailer.vehiclePhoto}">
                  <p class="form-control-static">
                    <a  data-imgsrc="${trailer.vehiclePhoto}" href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up">查看图片</a>
                  </p>
                </c:when>
                <c:otherwise>
                  <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                </c:otherwise>
              </c:choose>
            </div>
          </div>
  	    
  	    </div>

      </c:if>
	  
    </div>
	  
	</div>
	
	<%@ include file="/WEB-INF/include/script.jsp" %>

</body>
</html>